'''
系统函数
'''

# 19--匿名函数.pyz
li = [1,2,3,4,5,6,7,8,9]
print(li)
# for index ,item in enumerate(li):
#     li[index] = item * 2;
# print(li)

list2 = list(map( lambda item:  item *2 ,li))
print(list2)


from functools import reduce
li = [1,2,3,4,5,6,7,8,9]
# x y 1 2  result
# x y result  运算 3  result1
# x y result1  运算 4  result1


# x y 1    2  3
# x y 3  + 3 =   6
# x y 6  +  4 =   10
# x y 10 +  5 =  15
# x y 15  + 6  =  21
# x y 21  + 7  28
# x y 28  + 8  36
# x y 36  + 9  45
print(reduce(lambda x,y:x+y,li))



li = [10,15,16,14,12,17,18]
print(list)
print(list(filter(lambda  num: num %2==0,li)))
print(list(filter(lambda  num: num <=15,li)))
